package com.hurl.waguji.web.cx;

import java.util.Collections;
import java.util.List;

import freemarker.template.TemplateMethodModel;
import freemarker.template.TemplateModelException;

public class RevertArrayMethod implements TemplateMethodModel{

	@Override
	public Object exec(List list) throws TemplateModelException {
		if(list==null || list.isEmpty())
			throw new TemplateModelException("未指定参数");
		List fromArray = (List)list.get(0);
		if(fromArray==null)
			return null;
		Collections.reverse(fromArray);
		return fromArray;
	}

}
